<?php

namespace frontend\controllers;


use Yii;
use yii\web\Controller;

/**
 * Site controller
 */
class SiteController extends Controller
{

    /**
     * {@inheritdoc}
     */
    public function actions()
    {
        return [
//            'error' => [
//                'class' => 'yii\web\ErrorAction',
//            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    public function actionIndex()
    {
        echo 'success';
        exit();
    }
    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionError()
    {
        $exception = Yii::$app->getErrorHandler()->exception;
        if (!$exception) {
            $errorMsg = '未知错误';
        } else {
            $errorMsg = ($exception->getMessage());
        }
        return $this->renderPartial('error', ['errorMsg' => $errorMsg]);
    }

}
